package com.future.message.configuration.Security;

import com.future.message.Utils.ResponseResult;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @description:未验证成功！
 * @projectName:message
 * @see:com.future.message.configuration.Security
 * @author:Xuyujie
 * @createTime:2021/12/5 22:20
 * @version:1.0
 */
public class UnauthEntryPoint implements AuthenticationEntryPoint {
    @Override
    public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
        ResponseResult.out(response,ResponseResult.error("请先进行登录！"));
    }
}
